﻿@model View_ChargeOrder
@{
    ViewBag.Title = "充值订单详情";
    Layout = "~/Views/Shared/_ContentLayout.cshtml";

    ADZ_MasterEntities dbcontext = new ADZ_MasterEntities();
    Dictionary<string, string> dc = new Dictionary<string, string>();
}

<form id="S_Form" action="@Url.Action("defailinfo", "account")" method="post" class="definewidth m20" enctype="multipart/form-data">
    <h5>
        充值订单详情
    </h5>
    <table class="table table-bordered table-hover definewidth m10">

        <tr>
            <td width="10%" class="tableleft">充值订单号</td>
            <td>
                @Model.order_no
            </td>
            <td width="10%" class="tableleft">下单用户</td>
            <td>
                @Model.account_mobile 代购编号：@Model.replace_buyer_NO
            </td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">充值金额</td>
            <td>
                @Model.order_amt
            </td>
            <td class="tableleft">订单状态</td>
            <td>
                @{
                    int order_status = ConvertHelper.ConvertTo<int>(Model.status, 0);
                    switch (order_status)
                    {
                        case (int)ChargeOrderStatus.Create:
                            @:<div>@(MyEnumHelper.GetEnumItemDescription<ChargeOrderStatus>(order_status))</div>
                                break;
                        case (int)ChargeOrderStatus.PaySucc:
                            @:<div class="green">@(MyEnumHelper.GetEnumItemDescription<ChargeOrderStatus>(order_status))</div>
                                break;
                        case (int)ChargeOrderStatus.PayFail:
                            @:<div class="red">@(MyEnumHelper.GetEnumItemDescription<ChargeOrderStatus>(order_status))</div>
                                break;
                        @*case (int)ChargeOrderStatus.Refund:
                            @:<div class="gray">@(MyEnumHelper.GetEnumItemDescription<ChargeOrderStatus>(order_status))</div>
                                break;
                        case (int)ChargeOrderStatus.Cancel:
                            @:<div class="blue">@(MyEnumHelper.GetEnumItemDescription<ChargeOrderStatus>(order_status))</div>
                                break;
                        case (int)ChargeOrderStatus.Close:
                            @:<div class="red">@(MyEnumHelper.GetEnumItemDescription<ChargeOrderStatus>(order_status))</div>
                                break;*@
                    }
                }
            </td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">下单时间</td>
            <td>
                @Model.createtime.ToString(1)
            </td>
            <td class="tableleft">充值方式</td>
            <td>
                @(MyEnumHelper.GetEnumItemDescription<ChannelType>(ConvertHelper.ConvertTo<int>(Model.channel_type)))
            </td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">支付信息</td>
            <td>
                <div>下家billno：@Model.billno</div>
                @switch (Model.issuccess)
                {
                    case 1:
                        @:<div class="green">成功</div><div>下家订单号：@Model.sell_order_no</div><div>@Model.succ_time.ToString(1)</div>
                            break;
                    case 0:
                        @:<div class="red">未成功</div>@Model.sell_error_code @Model.sell_error_msg<div></div>
                            break;
                }
            </td>
            <td class="tableleft">付款订单信息</td>
            <td>
                @{
                    if (Model.order_master_id != 0)
                    {
                        var order_master_id = ConvertHelper.ConvertTo<long>(Model.order_master_id);
                        var order = dbcontext.View_Order.FirstOrDefault(t => t.order_id == order_master_id);
                        <div>订单号：@order.order_NO</div>
                        <div>下单时间：@order.create_time.ToString(1) <a href="@Url.Action("OrderMasterInfo", "OrderMaster", new { id = order.order_id})">查看详情</a></div>
                    }
                    else
                    {
                        <div>无</div>
                    }
                }
            </td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">备注</td>
            <td colspan="3">
                @Model.remark
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <button type="button" class="btn btn-success" name="backid" id="backid">返回</button>
            </td>
        </tr>
    </table>
</form>
